package br.com.gip.business.impl;


import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;




import br.com.gip.business.HistoricoArtefatoBusiness;

import br.com.gip.repository.dao.HistoricoArtefatoDao;

import br.com.gip.repository.model.HistoricoArtefato;


@Service
public class HistoricoArtefatoBusinessImpl implements HistoricoArtefatoBusiness {

	private static final long serialVersionUID = -2732680512471601799L;
	
	@Autowired
	private HistoricoArtefatoDao historicoArtefatoDao;

	@Override
	public void cadastrarHistoricoArtefato(HistoricoArtefato historicoArtefato) {
		this.historicoArtefatoDao.saveOrUpdate(historicoArtefato);
	}
	

	@Override
	public List<HistoricoArtefato> bucarHistoricoArtefato(String nomeArtefato) {
		return this.historicoArtefatoDao.findByFilter(nomeArtefato);
	}
	
	@Override
	public List<HistoricoArtefato> bucarHistoricoArtefato(Long idArtefato) {
		return this.historicoArtefatoDao.findByIdArtefato(idArtefato);
	}

	@Override
	public List<HistoricoArtefato> buscarHistoricoArtefatos() {
		return this.historicoArtefatoDao.findAll();
	}
	
	@Override
	public void removerHistoricoArtefato(HistoricoArtefato historicoArtefato) {
		this.historicoArtefatoDao.delete(historicoArtefato);
		
	}

}
 